# это проприетарные блобы
%define debug_package %{nil}
# byte-компиляция сбандленных кодов на python здесь не нужна
%define __brp_python_bytecompile %{nil}
# rpmlint странно падает, особого смысла проверять эту проприетарную штуку нет, отключим его
%define _build_pkgcheck_set %{nil}
%define _build_pkgcheck_srpm %{nil}

%define wingname %{name}10
%define wingfile %{wingname}-%{version}-%{rel}.x86_64.rpm
%define rel 0

Summary(ru_RU.UTF-8): Wing Personal Python IDE
Summary:	Wing Personal Python IDE
Name:		wing-personal
Version:	10.0.1
Release:	%{rel}.1
License:	Commercial
Group:		Development/Python
Url:		http://wingware.org/downloads/%{name}
Vendor:		Wingware
Source0:	https://wingware.com/pub/%{name}/%{version}.%{rel}/%{wingfile}
BuildRequires:	%{_bindir}/rpm2cpio
BuildRequires:	cpio
ExclusiveArch:	x86_64
AutoReqProv:	no

%description
Python IDE - An integrated development environment for the Python programming language

%description -l ru_RU.UTF-8
Python IDE - Среда разработки на языке Python

%files
%{_bindir}/%{wingname}
/usr/lib/%{wingname}
%{_iconsdir}/hicolor/*x*/apps/%{wingname}.png
%{_datadir}/applications/%{wingname}.desktop
%{_datadir}/pixmaps/%{wingname}.png

#------------------------------------------------------------------

%prep
%setup -T -c
cp %sources .
rpm2cpio %{wingfile} | cpio -idmv

%build

%install
cp -rf usr %{buildroot}

for i in 16 32 48 64 128
do
	mkdir -p %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps
	install -m644 usr/lib/%{wingname}/resources/wing"$i".png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/%{wingname}.png
done

mkdir -p %{buildroot}%{_datadir}/applications
install -m644 usr/lib/%{wingname}/resources/linux/desktop/%{wingname}.desktop %{buildroot}%{_datadir}/applications
